#region Copyright (C) 2007 Jens Winter

//Copyright (C) 2007 Jens Winter

//This library is free software; you can redistribute it and/or
//modify it under the terms of the GNU Lesser General Public
//License as published by the Free Software Foundation; either
//version 2.1 of the License, or (at your option) any later version.

//This library is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//Lesser General Public License for more details.

//You should have received a copy of the GNU Lesser General Public
//License along with this library; if not, write to the Free Software
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

#endregion

using System.Collections.Generic;
using System.Linq;
using Flynn.Core.ActivityResults;
using MbUnit.Framework;

namespace Flynn.Core.Tests.ActivityResults
{
    [TestFixture]
    public class FilterUpdatesResultFixture
    {
        [Test]
        public void Can_Create_Succeeded_Result()
        {
            IEnumerable<Update> filteredUpdates = new List<Update>();
            FilterUpdatesResult result = FilterUpdatesResult.Success(filteredUpdates);

            Assert.IsFalse(result.Failed);
            Assert.AreEqual(string.Empty, result.FailureMessage);
            Assert.AreSame(filteredUpdates, result.FilteredUpdates);
        }

        [Test]
        public void Can_Create_Failed_Result()
        {
            FilterUpdatesResult result = FilterUpdatesResult.Failure("Failure message");

            Assert.IsTrue(result.Failed);
            Assert.AreEqual("Failure message", result.FailureMessage);
        }
    }
}